package com.okcl.utils;

import com.okcl.model.entity.system.SysUser;

/**
 * 线程安全，用户信息
 */
public class AuthContextUtil {
    private static final ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    public static SysUser getUser() {
        return threadLocal.get();
    }

    public static void setUser(SysUser sysUser) {
        threadLocal.set(sysUser);
    }

    public static void remove() {
        threadLocal.remove();
    }
}
